import request from '@/common/request.js'

const api = {}

/**
 * 微信登录授权
 */
api.login = params => request.globalRequest(`user/Login`, 'POST', params)//POST必须大写，为了兼容其他应用

/**
 * 用户端
 */
//绑定手机
api.bindmobile = params => request.globalRequest(`User/Setmobile`, 'POST',params)
//小程序分享二维码
api.qrcode = params => request.globalRequest(`user/qrcode`, 'GET',params)
//合伙人参数获取(个人中心区域id为0的用户不开启这个接口)
api.get_partner = params => request.globalRequest(`User/set_partner`, 'GET',params)
//合伙人参数设置
api.set_partner = params => request.globalRequest(`User/set_partner`, 'POST', params)
//意见反馈列表
api.feedback_list = params => request.globalRequest(`User/message`, 'GET', params)
//意见反馈
api.feedback = params => request.globalRequest(`User/message`, 'POST', params)
//我的积分记录
api.integral_record = params => request.globalRequest(`User/integral`, 'GET', params)
//用户个人信息
api.info = params => request.globalRequest(`User/info`, 'GET', params)
//申请骑手
api.rider_apply = params => request.globalRequest(`User/RiderApply`, 'POST', params)
//申请骑手信息
api.rider_apply_info = params => request.globalRequest(`User/RiderApply`, 'GET', params)
//申请合伙人信息
api.partner_apply_info = params => request.globalRequest(`User/partnerApply`, 'GET', params)
//招募合伙人
api.partner_apply = params => request.globalRequest(`user/partnerApply`, 'POST', params)
//订单详情(返回参数参考订单列表)
api.order_detail = params => request.globalRequest(`user/orderdetail`, 'GET', params)
//取消订单
api.order_cancel = params => request.globalRequest(`user/ordercancel`, 'GET', params)
//回收订单列表
api.order_list = params => request.globalRequest(`user/orderlist`, 'GET', params)
//回收下单
api.order = params => request.globalRequest(`user/order`, 'POST', params)
//今日指导价
api.get_price = params => request.globalRequest(`user/getprice`, 'GET', params)
//分类类别
api.garbagecate = params => request.globalRequest(`user/garbagecate`, 'GET', params)
//获取区域价格、规格
api.areaprice = params => request.globalRequest(`user/areaprice`, 'GET', params)
//街道获取
api.getstreet = params => request.globalRequest(`user/getstreet`, 'GET', params)
//地址详情（返回信息参考地址列表）
api.address_detail = params => request.globalRequest(`user/address_detail`, 'GET', params)
//我的地址列表（如果有默认地址，默认是数组第一个）
api.address = params => request.globalRequest(`user/address`, 'GET', params)
//用户添加|修改回收地址
api.add_address = params => request.globalRequest(`user/address`, 'POST', params)
//删除地址
api.del_address = params => request.globalRequest(`user/del_address`, 'POST', params)
//判断可否下单
api.canOrder = params => request.globalRequest(`user/order`, 'GET', params)

/**
 * 公告轮播图
 */
//图片上传
api.uploads = params => request.globalRequest(`other/uploads`, 'POST', params)
//发送短信
api.sendmns = params => request.globalRequest(`other/sendmns`, 'POST', params)
//用户端公告|骑手端通知
api.annou = params => request.globalRequest(`other/annou`, 'GET', params)
//轮播图
api.banner = params => request.globalRequest(`other/banner`, 'GET', params)
//关于我们|首页免责说明|规则与协议|在线学习（除在线学习，其它3个只选第一条数据）
api.news = params => request.globalRequest(`other/News`, 'GET', params)
//经纬度获取区域行政id
api.geocoder = params => request.globalRequest(`other/geocoder`, 'GET', params)
//获取地图key
api.getkey = params => request.globalRequest(`other/geocoder`, 'POST', params)

/**
 * 骑手端
 */
//骑手信息
api.getinfo = params => request.globalRequest(`rider/getinfo`, 'GET', params)
//骑手状态切换开关
api.getstatus = params => request.globalRequest(`rider/getstatus`, 'GET', params)
//搜索骑手
api.serrider = params => request.globalRequest(`rider/serrider`, 'GET', params)
//我的统计
api.rank = params => request.globalRequest(`rider/rank`, 'GET', params)
//订单取货完成
api.confirmorder = params => request.globalRequest(`rider/confirmorder`, 'POST', params)
//订单转让
api.returnorder = params => request.globalRequest(`rider/returnorder`, 'POST', params)
//问题反馈列表
api.rider_feedback_list = params => request.globalRequest(`rider/message`, 'GET', params)
//问题反馈
api.rider_feedback = params => request.globalRequest(`rider/message`, 'POST', params)
//更改密码
api.setpassword = params => request.globalRequest(`rider/setpassword`, 'POST', params)
//修改手机号码
api.setmobile = params => request.globalRequest(`rider/setmobile`, 'POST', params)
//申请新街道
api.apply_riderstreet = params => request.globalRequest(`rider/riderstreet`, 'POST', params)
//骑手街道管理
api.riderstreet = params => request.globalRequest(`rider/riderstreet`, 'GET', params)
//订单接单
api.orders = params => request.globalRequest(`rider/orders`, 'GET', params)
//订单详情
api.rider_order_detail = params => request.globalRequest(`rider/orderdetail`, 'GET', params)
//订单大厅（返回信息参考用户端，这里多加了个买家电话mobile字段）
api.rider_order_list = params => request.globalRequest(`rider/Orderlist`, 'GET', params)
//骑手登录
api.rider_login = params => request.globalRequest(`rider/login`, 'POST', params)
//订单删除
api.orderlog_del = params => request.globalRequest(`rider/orderlog_del`, 'POST', params)
//订单添加品类
api.order_cat = params => request.globalRequest(`rider/order_cat`, 'POST', params)

/**
 * 积分商城
 */
//取消|确认订单
api.cacelconfirm = params => request.globalRequest(`goods/cacelconfirm`, 'GET', params)
//订单详情
api.goods_order_detail = params => request.globalRequest(`goods/orderdetail`, 'GET', params)
//我的订单
api.goods_order = params => request.globalRequest(`goods/order`, 'GET', params)
//下单兑换
api.add_order = params => request.globalRequest(`goods/add_order`, 'POST', params)
//商品详情
api.goodsdetail = params => request.globalRequest(`goods/goodsdetail`, 'GET', params)
//分类下商品
api.categoods = params => request.globalRequest(`goods/categoods`, 'GET', params)
//分类
api.goods_cate = params => request.globalRequest(`goods/cate`, 'GET', params)
//专题图片
api.goods_banner = params => request.globalRequest(`goods/banner`, 'GET', params)

export default api